package com.tjhzzx.ibmsSupervisor.model.menu;

import com.tjhzzx.ibmsSupervisor.enums.BTreeMenuItemType;
import com.tjhzzx.ibmsSupervisor.model.search.BSearchParamRoot;

import javax.baja.agent.BPxView;
import javax.baja.sys.BComponent;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;

//@NiagaraProperty(
//    name = "title", type = "baja:String",
//    defaultValue = ""
//)
//
//@NiagaraProperty(
//    name = "ord", type = "baja:Ord",
//    defaultValue = "BOrd.DEFAULT"
//)

//@NiagaraType
public class BTreeMenuItem extends BComponent {
    /*+ ------------ BEGIN BAJA AUTO GENERATED CODE ------------ +*/
    /*@ $com.tjhzzx.thinkinglabSupervisor.entities.menu.BTreeMenuItem(3475654544)1.0$ @*/
    /* Generated Thu Mar 14 18:44:39 CST 2019 by Slot-o-Matic (c) Tridium, Inc. 2012 */

////////////////////////////////////////////////////////////////
// Property "title"
////////////////////////////////////////////////////////////////

    /**
     * Slot for the {@code title} property.
     *
     * @see #getTitle
     * @see #setTitle
     */
    public static final Property title = newProperty(0, "通用子菜单", null);

    /**
     * Get the {@code title} property.
     *
     * @see #title
     */
    public String getTitle() {
        return getString(title);
    }

    /**
     * Set the {@code title} property.
     *
     * @see #title
     */
    public void setTitle(String v) {
        setString(title, v, null);
    }

    public static final Property nIcon = newProperty(0, "file", null);

    public String getNIcon() {
        return getString(nIcon);
    }

    public void setNIcon(String v) {
        setString(nIcon, v, null);
    }

    public static final Property treeMenuItemType = newProperty(0, BTreeMenuItemType.page, null);

    public BTreeMenuItemType getTreeMenuItemType() {
        return (BTreeMenuItemType) get(treeMenuItemType);
    }

    public void setTreeMenuItemType(BTreeMenuItemType v) {
        set(treeMenuItemType, v, null);
    }

    public static final Property pagePath = newProperty(0, "/", null);

    public String getPagePath() {
        return getString(pagePath);
    }

    public void setPagePath(String v) {
        setString(pagePath, v, null);
    }

    public static final Property pxView = newProperty(0, new BPxView(), null);

    public BPxView getPxView() {
        return (BPxView) get(pxView);
    }

    public void setPxView(BPxView v) {
        set(pxView, v, null);
    }

    public static final Property searchParamRoot = newProperty(0, new BSearchParamRoot(), null);

    public BSearchParamRoot getSearchParamRoot() {
        return (BSearchParamRoot) get(searchParamRoot);
    }

    public void setSearchParamRoot(BSearchParamRoot v) {
        set(searchParamRoot, v, null);
    }

    public static final Property url = newProperty(0, "外部链接 http://", null);

    public String getUrl() {
        return getString(url);
    }

    public void setUrl(String v) {
        setString(url, v, null);
    }

//    @Override
//    public void changed(Property property, Context context) {
//        super.changed(property, context);
//        if (property.getType() == BTreeMenuItemType.TYPE) {
//            String tag = propertyValueToString(property, context);
//            if (tag.equals(BTreeMenuItemType.pxView.toString(context))) {
//                this.setFlags(this.getSlot("searchParamRoot"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("carouselPage"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("velocityName"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("url"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("pxView"), 0, Context.commit);
//            } else if (tag.equals(BTreeMenuItemType.searchParams.toString(context))) {
//                this.setFlags(this.getSlot("carouselPage"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("velocityName"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("url"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("pxView"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("searchParamRoot"), 0, Context.commit);
//            } else if (tag.equals(BTreeMenuItemType.carouselPage.toString(context))) {
//                this.setFlags(this.getSlot("velocityName"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("url"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("pxView"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("searchParamRoot"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("carouselPage"), 0, Context.commit);
//            } else if (tag.equals(BTreeMenuItemType.url.toString(context))) {
//                this.setFlags(this.getSlot("velocityName"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("pxView"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("searchParamRoot"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("carouselPage"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("url"), 0, Context.commit);
//            } else {
//                this.setFlags(this.getSlot("pxView"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("searchParamRoot"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("carouselPage"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("url"), Flags.HIDDEN, Context.commit);
//                this.setFlags(this.getSlot("velocityName"), 0, Context.commit);
//            }
//        }
//    }

////////////////////////////////////////////////////////////////
// Type
////////////////////////////////////////////////////////////////

    @Override
    public Type getType() {
        return TYPE;
    }

    public static final Type TYPE = Sys.loadType(BTreeMenuItem.class);

    /*+ ------------ END BAJA AUTO GENERATED CODE -------------- +*/

}
